/**
 * @author planderos
 * Handle info popup
 */


function infoPopupButtonHandler(e)
{
	var dctk = connected.toolkit;

	switch(e.buttonId)
	{
		case dcKeyEvent.BUTTON_ID_BACK:
		{
			dctk.dismissPopup();
		}
		break;
		
		case dcKeyEvent.BUTTON_ID_MENU:
		{
			dctk.dismissPopup();
			showQueueIdPopup();
		}
		break;

	}
}

function showInfoPopup()
{
	var dctk = connected.toolkit;
	
	// create a new panel for the popup
	var popup = dctk.createPanelCtrl("popup", true);
	popup.width = 320;
	popup.height = 240;
	popup.outlined = true;
	popup.filled = true;
	popup.color.rgb = 0x000000;
	popup.color.a = 192;
	popup.onUnhandledKeyEvent = infoPopupButtonHandler;
	
	var infoHeadTxt = dctk.createLabelCtrl("infoHeadTxt", true);
	infoHeadTxt.setRect(0, 190, 300, 220);
	infoHeadTxt.textColor.rgb = 0xCDCDCD;
	infoHeadTxt.fontSize = 26;
	infoHeadTxt.text = "Plug-in Not Compatible";
	infoHeadTxt.align = dctkLabel.TS_CENTER;
	infoHeadTxt.valign = dctkLabel.TS_MIDDLE;
	popup.addChild(infoHeadTxt);
	
	var infoNoteTxt = dctk.createLabelCtrl("infoNoteTxt", true);
	infoNoteTxt.setRect(25, 10, 300, 180);
	infoNoteTxt.textColor.rgb = 0xCDCDCD;
	infoNoteTxt.fontSize = 17;
	infoNoteTxt.text = "Sorry, but at this time, all the features of this plug-in are not compatible with this device.\n\n Currently, it works only on the \"Connected PC\" client, which is available on your PC.\n\n You may press BACK to play with the UI, but videos will not work properly on this device.\n\n";
	infoNoteTxt.multiline = true;
	infoNoteTxt.align = dctkLabel.TS_LEFT;
	infoNoteTxt.valign = dctkLabel.TS_MIDDLE;
	popup.addChild(infoNoteTxt);
	

	
	
	// show the popup
	dctk.invokePopup(popup);
	

}
